Integrand size = 31, antiderivative size = 101 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {(a A+b B) x}{a^2+b^2}-\frac {(A b-a B) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a^2 (A b-a B) \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d} \]
[Out]
Time = 0.24 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3687, 3707, 3698, 31, 3556} \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {a^2 (A b-a B) \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}-\frac {(A b-a B) \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {x (a A+b B)}{a^2+b^2}+\frac {B \tan (c+d x)}{b d} \]
[In]
[Out]
Rule 31
Rule 3556
Rule 3687
Rule 3698
Rule 3707
Rubi steps \begin{align*} \text {integral}& = \frac {B \tan (c+d x)}{b d}+\frac {\int \frac {-a B-b B \tan (c+d x)+(A b-a B) \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b} \\ & = -\frac {(a A+b B) x}{a^2+b^2}+\frac {B \tan (c+d x)}{b d}+\frac {(A b-a B) \int \tan (c+d x) \, dx}{a^2+b^2}+\frac {\left (a^2 (A b-a B)\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )} \\ & = -\frac {(a A+b B) x}{a^2+b^2}-\frac {(A b-a B) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d}+\frac {\left (a^2 (A b-a B)\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^2 \left (a^2+b^2\right ) d} \\ & = -\frac {(a A+b B) x}{a^2+b^2}-\frac {(A b-a B) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a^2 (A b-a B) \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.66 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.17 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {\frac {i (A+i B) \log (i-\tan (c+d x))}{a+i b}-\frac {(i A+B) \log (i+\tan (c+d x))}{a-i b}+\frac {2 a^2 (A b-a B) \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right )}+\frac {2 B \tan (c+d x)}{b}}{2 d} \]
[In]
[Out]
Time = 0.09 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (d x +c \right ) B}{b}+\frac {\frac {\left (A b -B a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-a A -B b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {a^{2} \left (A b -B a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{d}\) | \(101\) |
default | \(\frac {\frac {\tan \left (d x +c \right ) B}{b}+\frac {\frac {\left (A b -B a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-a A -B b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {a^{2} \left (A b -B a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{d}\) | \(101\) |
norman | \(\frac {B \tan \left (d x +c \right )}{b d}-\frac {\left (a A +B b \right ) x}{a^{2}+b^{2}}+\frac {a^{2} \left (A b -B a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right ) d}+\frac {\left (A b -B a \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}\) | \(106\) |
parallelrisch | \(\frac {-2 A a \,b^{2} d x -2 B \,b^{3} d x +A \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) b^{3}+2 A \ln \left (a +b \tan \left (d x +c \right )\right ) a^{2} b -B \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a \,b^{2}-2 B \ln \left (a +b \tan \left (d x +c \right )\right ) a^{3}+2 B \,a^{2} b \tan \left (d x +c \right )+2 B \,b^{3} \tan \left (d x +c \right )}{2 d \left (a^{2}+b^{2}\right ) b^{2}}\) | \(130\) |
risch | \(-\frac {i x B}{i b -a}+\frac {x A}{i b -a}+\frac {2 i A x}{b}+\frac {2 i A c}{b d}-\frac {2 i a B x}{b^{2}}-\frac {2 i B a c}{b^{2} d}-\frac {2 i a^{2} A x}{\left (a^{2}+b^{2}\right ) b}-\frac {2 i a^{2} A c}{d \left (a^{2}+b^{2}\right ) b}+\frac {2 i a^{3} B x}{b^{2} \left (a^{2}+b^{2}\right )}+\frac {2 i a^{3} B c}{d \left (a^{2}+b^{2}\right ) b^{2}}+\frac {2 i B}{d b \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A}{b d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B a}{b^{2} d}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) A}{d \left (a^{2}+b^{2}\right ) b}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) B}{d \left (a^{2}+b^{2}\right ) b^{2}}\) | \(320\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.48 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {2 \, {\left (A a b^{2} + B b^{3}\right )} d x + {\left (B a^{3} - A a^{2} b\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - {\left (B a^{3} - A a^{2} b + B a b^{2} - A b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 2 \, {\left (B a^{2} b + B b^{3}\right )} \tan \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} d} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.69 (sec) , antiderivative size = 1015, normalized size of antiderivative = 10.05 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.08 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {\frac {2 \, {\left (A a + B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (B a^{3} - A a^{2} b\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b^{2} + b^{4}} + \frac {{\left (B a - A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, B \tan \left (d x + c\right )}{b}}{2 \, d} \]
[In]
[Out]
none
Time = 0.49 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.09 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=-\frac {\frac {2 \, {\left (A a + B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {{\left (B a - A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, {\left (B a^{3} - A a^{2} b\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{2} + b^{4}} - \frac {2 \, B \tan \left (d x + c\right )}{b}}{2 \, d} \]
[In]
[Out]
Time = 7.84 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.16 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{a+b \tan (c+d x)} \, dx=\frac {B\,\mathrm {tan}\left (c+d\,x\right )}{b\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (B\,a^3-A\,a^2\,b\right )}{d\,\left (a^2\,b^2+b^4\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-B+A\,1{}\mathrm {i}\right )}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \]
[In]
[Out]